<template>
    <div style="background-color: white">
        <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/' }"><i class="el-icon-s-promotion"></i>后台管理</el-breadcrumb-item>
            <el-breadcrumb-item>添加品牌</el-breadcrumb-item>
        </el-breadcrumb>
        <el-divider></el-divider>
        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
            <el-form-item label="品牌名称" prop="name">
                <el-input v-model="ruleForm.username"></el-input>
            </el-form-item>
            <el-form-item label="品牌拼音" prop="pinyin">
                <el-input v-model="ruleForm.password"></el-input>
            </el-form-item>

            <el-form-item label="简介" prop="description">
                <el-input v-model="ruleForm.description"></el-input>
            </el-form-item>
            <el-form-item label="关键词列表" prop="keywords">
                <el-input v-model="ruleForm.phone"></el-input>
            </el-form-item>
            <el-form-item label="排序" prop="sort">
                <el-input v-model="ruleForm.sorts"></el-input>
            </el-form-item>
            <el-form-item label="是否启用" prop="enable">
                <el-switch
                        v-model="ruleForm.enable"
                        :active-value="1"
                        :inactive-value="0"
                        active-color="#13ce66"
                        inactive-color="#ccc">
                </el-switch>
            </el-form-item>
            <el-form-item label="LOGO" prop="logo">
                <el-upload
                        limit="1"
                        action="https://jsonplaceholder.typicode.com/posts/"
                        list-type="picture-card"
                        :on-preview="handlePictureCardPreview"
                        :on-remove="handleRemove">
                    <i class="el-icon-plus"></i>
                </el-upload>
                <el-dialog :visible.sync="dialogVisible">
                    <img width="100%" :src="dialogImageUrl" alt="">
                </el-dialog>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="">添加</el-button>
                <el-button @click="">重置</el-button>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                ruleForm: [],
                rules: [],
                dialogImageUrl: '',
                dialogVisible: false

            }
        },
        methods: {
            handleRemove(file, fileList) {
                console.log(file, fileList);
            },
            handlePictureCardPreview(file) {
                this.dialogImageUrl = file.url;
                this.dialogVisible = true;
            }
        }
    }
</script>

